check = zeros(1000,1);

data_L = struct();
count = 1;

for i=1:1000
    % if data(i).l1_norm > 3000
    if data(i).l1_norm < 3000
        data_L(count).bfu = data(i).bfu;
        data_L(count).l1_norm = data(i).l1_norm;
        check(i)=1;
        count = count + 1;
    end
end

data_U = struct();
count = 1;

for i=1:1000
    if data(i).l1_norm > 3000
    % if data(i).l1_norm < 3000
        data_U(count).bfu = data(i).bfu;
        data_U(count).l1_norm = data(i).l1_norm;
        check(i)=1;
        count = count + 1;
    end
end

nancount = 0;
for i = 1:1000
    if isnan(data(i).l1_norm)
        nancount = nancount+1;
        check(i)=1;
    end
end

clear count i data